<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="father">
        <div class="son">son儿子</div>
    </div>
    <script>
        // 常见事件对象的属性和方法
        // 阻止冒泡 dom 推荐的标准 stopPropagation()
        var son = document.querySelector('.son');
        son.addEventListener('click', function() {
            alert('son');
            e.stopPropagation(); // stop 停止 Propagetion 传播   就是让son 不会在冒泡上去找fahter了
            e.cancelBubble = ture; //非标准 cancel 取消 bubble 泡泡  这是用来ie的兼容
        }, false);
        var father = document.querySelector('.father');
        father.addEventListener('click', function() {
            alert('father');
        }, false);
        document.addEventListener('click', function() {
            alert('document');
        })
    </script>
</body>

</html>